<template>
    <div>
        <el-col :span="12">

            <el-menu
                    :default-active="path"
                    router
                    style="width: 200px;min-height: calc(110vh - 50px);"
                    id="aside"
                    class="el-menu-vertical-demo"
                    @open="handleOpen"
                    @close="handleClose"
                    background-color="#545c64"
                    text-color="#fff"
                    active-text-color="#ffd04b">
                <!--菜单-->
               <!-- <el-menu-item index="/dashboard">
                    <i class="el-icon-location"></i>
                    <span slot="title">首页</span>
                </el-menu-item>-->

                <!--动态菜单-->
                <el-menu-item :index="item.path" v-for="item in user.permissions" :key="item.id">
                    <i :class="item.icon"></i>
                    <span slot="title">{{item.comment}}</span>
                </el-menu-item>
               <!-- <el-submenu index="1">
                    <template slot="title">
                        <i class="el-icon-menu"></i>
                        <span>系统管理</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="/users">
                            <i class="el-icon-user-solid"></i>
                            <span slot="title">用户信息</span>
                        </el-menu-item>
                        <el-menu-item index="/base">
                            <i class="el-icon-document"></i>
                            <span slot="title">信息展示</span>
                        </el-menu-item>
                        <el-menu-item index="/AuditPage">
                            <i class="el-icon-s-custom"></i>
                            <span slot="title">审核</span>
                        </el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
                &lt;!&ndash;图书&ndash;&gt;
                <el-menu-item index="/book">
                    <i class="el-icon-reading"></i>
                    <span slot="title">阅读赏析</span>
                </el-menu-item>
                &lt;!&ndash;动态&ndash;&gt;
                <el-menu-item index="/news">
                    <i class="el-icon-s-promotion"></i>
                    <span slot="title">我的动态</span>
                </el-menu-item>

                &lt;!&ndash;留言&ndash;&gt;
                <el-menu-item index="/message">
                    <i class="el-icon-chat-line-round"></i>
                    <span slot="title">评论与回复</span>
                </el-menu-item>
                &lt;!&ndash; 数据分析&ndash;&gt;
                <el-menu-item index="/Analysis">
                    <i class="el-icon-s-data"></i>
                    <span slot="title">数据分析</span>
                </el-menu-item>
                &lt;!&ndash;天气情况&ndash;&gt;
                <el-menu-item index="/weather">
                    <i class="el-icon-cloudy-and-sunny"></i>
                    <span slot="title">天气情况</span>
                </el-menu-item>
                <el-menu-item index="/map">
                    <i class="el-icon-map-location"></i>
                    <span slot="title">地图</span>
                </el-menu-item>
                <el-menu-item index="/about">
                    <i class="el-icon-hot-water"></i>
                    <span slot="title">请作者喝杯茶</span>
                </el-menu-item>-->
            </el-menu>
        </el-col>
    </div>
</template>

<script>
    export default {
        name: "Aside",
        data() {
            return {
                path: this.$route.path , //设置高亮
                user:{}
            }
        },
        created(){
            let userStr=sessionStorage.getItem("user")
            this.user=JSON.parse(userStr)

        },
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    }
</script>

<style scoped>

    #aside {

    }


</style>
